<?php
/**
 * CreateTime: 2023/6/30 18:26
 */

namespace App\Tools\Log;

class QxwgSMSCallBackLog
{

    public static function i($msg)
    {
        self::write('I', $msg);
    }

    public static function e($msg)
    {
        self::write('E', $msg);
    }

    public static function g(){
        return file_get_contents(__DIR__.DIRECTORY_SEPARATOR."isv2.log");
    }

    private static function write($level, $msg)
    {
        $filename = __DIR__ .DIRECTORY_SEPARATOR. "qxwg_sms_isv2_$level.log";
        $logFile = fopen($filename, "aw");
        fwrite($logFile, $level . "/" . date(" Y-m-d h:i:s") . "  " . $msg . "\n");
        fclose($logFile);
    }
}